﻿#include "daemonlogservice.h"
#include <databasecenter.h>
DaemonLogService::DaemonLogService(QObject *parent) : QObject(parent)
{
    db = DatabaseCenter::getInstance()->getConnection();
}

DaemonLogService::~DaemonLogService()
{
    DatabaseCenter::getInstance()->releaseConnection(db);
}

bool DaemonLogService::getPageList(uint64_t &total, QList<DaemonLog> &list, const uint64_t &page, const uint64_t &pageSize,QString &progressName)
{
    DaemonLogDao objectDao(db);
    return (objectDao.getTotalByParam(total,progressName) && objectDao.getPageListByParam(list,page,pageSize,progressName));
}


bool DaemonLogService::getList(QList<DaemonLog> &list)
{
    DaemonLogDao objectDao(db);
    return (objectDao.getList(list));
}

bool DaemonLogService::getOne(DaemonLog &object)
{
    DaemonLogDao objectDao(db);
    return (objectDao.getOne(object));
}

bool DaemonLogService::saveOne(DaemonLog &object)
{
    DaemonLogDao objectDao(db);
    return (objectDao.saveOne(object));
}

bool DaemonLogService::deleteOne(DaemonLog &object)
{
    DaemonLogDao objectDao(db);
    return (objectDao.deleteOne(object));
}

bool DaemonLogService::deleteAll()
{
    DaemonLogDao objectDao(db);
    return (objectDao.deleteAll());
}
